package it.traveldream.viewer;

import it.traveldreamClient.beans.ClientManagerInterface;
import it.traveldreamClient.beans.UserMgr;
import it.traveldreamClient.beans.dto.ComponenteDTO;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean(name="viewr")
@RequestScoped
public class ShowComponentiRegaliBean {
	@EJB 
	private UserMgr usr;
	@EJB
	private ClientManagerInterface mk;
	
	
	private List<ComponenteDTO> RegaliL;
	
	private ComponenteDTO selectedComponente;

	public ShowComponentiRegaliBean() {
		
	}
		
	@PostConstruct
	public void init(){
		RegaliL = mk.getRegaliList(usr.getMailActualUser());
		
		
		
	}

	
	
	
	public List<ComponenteDTO> getRegaliL() {
		return RegaliL;
	}

	public void setRegaliL(List<ComponenteDTO> regali) {
		RegaliL = regali;
	}

	public ComponenteDTO getselectedComponente() {
		return selectedComponente;
	}

	public void setselectedComponente(ComponenteDTO selectedComponente) {
		this.selectedComponente = selectedComponente;
	}

	public String showPkg(){
		return "/"+usr.getUrlRole()+"/"+"index?faces-redirect=true";
	}


	public UserMgr getUsr() {
		return usr;
	}

	public void setUsr(UserMgr usr) {
		this.usr = usr;
	}
	
}
